import Layout from '@/App.vue';

import '@/shared/styles/base.scss';
import OIcon from '@/components/OIcon.vue';
import i18n from '@/i18n';

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';

import DefaultTheme from 'vitepress/theme';
export default {
  // ...DefaultTheme,
  Layout,
  NotFound: () => 'custom 404', // <- this is a Vue 3 functional component
  enhanceApp({ app, router, siteData }) {
    app.use(i18n);
    app.use(ElementPlus);
    app.component('OIcon', OIcon);

    if (typeof global === 'undefined') {
      const isDark =
        window.matchMedia &&
        window.matchMedia('(prefers-color-scheme: dark)').matches;
      document.body.classList.add(isDark ? 'dark' : 'light');
    }
  },
};
